/*-------------------------------------------------------- 
* Module Name : OLDialogSurface
* Version : 1.0
* 
* Software Name : Qt App Template
* Version : 1.0
*
* Copyright � 2010 � 2011 France T�l�com
* This software is distributed under the LGPL v2.1 license,
* the text of which is available at http://www.gnu.org/licenses/lgpl-2.1.html
* or see the "LICENSE.txt" file for more details.
*
*--------------------------------------------------------
* File Name   : OLDialogSurface.h
*
* Created     : 07 June 2011
* Author(s)   : Omer Saleem
*
* Description :
* The modal background surface for the dialogs (OLDialog)
* to be rendered on.
*
*--------------------------------------------------------
* 1.0 - First open source release
*
*/

#ifndef OLDIALOGSURFACE_H
#define OLDIALOGSURFACE_H

#include <QWidget>

#include "OLModalBackground.h"
#include "OLApplication.h"

class QPropertyAnimation;
class OLDialog;
class OLDialogTitle;

class OLDialogSurface : public OLModalBackground
{
    Q_OBJECT
public:
    OLDialogSurface(const QPixmap& icon, const QString& title, QLayout* body, const OLButtonList& buttons, QWidget *parent);

public slots:
    void showDialog();
    void dismissDialog();

    void handleParentResize();
    void handleAnimFinished();

signals:
    void portraitSwitch();
    void landscapeSwitch();

    void dialogClosed(int id);

protected:
    virtual void resizeEvent(QResizeEvent * e);

private:
    QPropertyAnimation* m_anim;
    OLDialog* m_dialog;

};

#endif // OLDIALOGSURFACE_H
